#include <iostream>
#include <vector>
#include "common.h"
using namespace std;

class Solution {
public:
    void reOrderArray(vector<int> &array) {
        int p = 0;
        vector<int> even;
        for (int index = 0; index < array.size(); index++) {
            if (array[index] & 1) {
                array[p++] = array[index];
            } else {
                even.push_back(array[index]);
            }
        }
        copy(even.begin(), even.end(), array.begin() + p);
    }
};

int main() {
    vector<int> array = {1, 2, 3, 4, 5, 6};
    Solution().reOrderArray(array);
    cout << array << endl;
    return 0;
}